<?php

/**
 * @author vladone
 * @copyright 2007
 */

include ('include/conf.php');
no_cache();
$id_connect = connect_to_database(HOST, USER, PASS, DATABASE);
$str = "SELECT DATE_FORMAT(FROM_UNIXTIME(data_in),'%d %b %Y') AS mydate, SUM(cost) AS valoare FROM coduri GROUP BY mydate ORDER BY data_in DESC LIMIT 30";
$result = mysql_query($str,$id_connect);
echo '<?xml version="1.0" encoding="utf-8"?>';
echo "\n<xport>\n<data>";
while ($value = mysql_fetch_assoc($result)) {
	echo "\n<row><v>".$value['valoare']."</v><t>".$value['mydate']."</t></row>";	
}
echo "\n</data>\n</xport>";
?>